home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / DDJ0192.ARJ / DFLAT.H < prev    next >
Text File  |  1991-10-30  |  20KB  |  450 lines

  1. /* ------------- dflat.h ----------- */
  2. #ifndef DFLAT_H
  3. #define DFLAT_H
  4.  
  5. #include <stdio.h>
  6. #include <string.h>
  7. #include <stdlib.h>
  8. #include <dos.h>
  9. #include <process.h>
  10. #include <conio.h>
  11. #include <bios.h>
  12. #include <ctype.h>
  13. #include <io.h>
  14. #include <sys\types.h>
  15. #include <sys\stat.h>
  16. #include <time.h>
  17.  
  18. #define VERSION "Version 9.x"
  19.  
  20. #define TRUE 1
  21. #define FALSE 0
  22.  
  23. #define MAXMESSAGES 50
  24. #define DELAYTICKS 1
  25. #define FIRSTDELAY 7
  26. #define DOUBLETICKS 5
  27.  
  28. #define MAXTEXTLEN 65000U /* maximum text buffer            */
  29. #define EDITLEN     1024  /* starting length for multiliner */
  30. #define ENTRYLEN     256  /* starting length for one-liner  */
  31. #define GROWLENGTH    64  /* buffers grow by this much      */
  32.  
  33. #include "system.h"
  34. #include "config.h"
  35. #include "rect.h"
  36. #include "menu.h"
  37. #include "keys.h"
  38. #include "commands.h"
  39. #include "dialbox.h"
  40.  
  41. /* ------ integer type for message parameters ----- */
  42. typedef long PARAM;
  43.  
  44. typedef struct window {
  45.     CLASS class;           /* window class                  */
  46.     char *title;           /* window title                  */
  47.     struct window *parent; /* parent window                 */
  48.     int (*wndproc)
  49.         (struct window *, enum messages, PARAM, PARAM);
  50.     /* ----------------- window colors -------------------- */
  51.     char WindowColors[4][2];
  52.     /* ---------------- window dimensions ----------------- */
  53.     RECT rc;               /* window coordinates
  54.                                             (0/0 to 79/24)  */
  55.     int ht, wd;            /* window height and width       */
  56.     RECT RestoredRC;       /* restored condition rect       */
  57.     /* -------------- linked list pointers ---------------- */
  58.     struct window *nextfocus;   /* next window on screen    */
  59.     struct window *prevfocus;   /* previous window on screen*/
  60.     struct window *nextbuilt;   /* next window built        */
  61.     struct window *prevbuilt;   /* previous window built    */
  62.  
  63.     int attrib;                 /* Window attributes        */
  64.     char *videosave;            /* video save buffer        */
  65.     int condition;              /* Restored, Maximized,
  66.                                    Minimized, Closing       */
  67.     int oldcondition;           /* previous condition       */
  68.     int restored_attrib;        /* attributes when restored */
  69.     void *extension;      /* menus, dialogs, documents, etc */
  70.     struct window *PrevMouse;
  71.     struct window *PrevKeyboard;
  72.     struct window *MenuBarWnd;/* menu bar                   */
  73.     struct window *StatusBar; /* status bar                 */
  74.     /* ----------------- text box fields ------------------ */
  75.     int wlines;     /* number of lines of text              */
  76.     int wtop;       /* text line that is on the top display */
  77.     unsigned char *text; /* window text                     */
  78.     unsigned int textlen;  /* text length                   */
  79.     int wleft;      /* left position in window viewport     */
  80.     int textwidth;  /* width of longest line in textbox     */
  81.     int BlkBegLine; /* beginning line of marked block       */
  82.     int BlkBegCol;  /* beginning column of marked block     */
  83.     int BlkEndLine; /* ending line of marked block          */
  84.     int BlkEndCol;  /* ending column of marked block        */
  85.     int HScrollBox; /* position of horizontal scroll box    */
  86.     int VScrollBox; /* position of vertical scroll box      */
  87.     unsigned int *TextPointers; /* -> list of line offsets    */
  88.     /* ----------------- list box fields ------------------ */
  89.     int selection;  /* current selection                    */
  90.     int AddMode;    /* adding extended selections mode      */
  91.     int AnchorPoint;/* anchor point for extended selections */
  92.     int SelectCount;/* count of selected items              */
  93.     /* ----------------- edit box fields ------------------ */
  94.     int CurrCol;    /* Current column                       */
  95.     int CurrLine;   /* Current line                         */
  96.     int WndRow;     /* Current window row                   */
  97.     int TextChanged; /* TRUE if text has changed            */
  98.     unsigned char *DeletedText; /* for undo                 */
  99.     int DeletedLength; /* Length of deleted field           */
  100.     int InsertMode;    /* TRUE or FALSE for text insert     */
  101.     int WordWrapMode;  /* TRUE or FALSE for word wrap       */
  102.     unsigned int MaxTextLength; /* maximum text length      */
  103.     /* ---------------- dialog box fields ----------------- */
  104.     void *dFocus;          /* control that has the focus    */
  105.     int ReturnCode;        /* return code from a dialog box */
  106.     int Modal;               /* True if a modeless dialog box */
  107.     CTLWINDOW *ct;           /* control structure             */
  108.     /* -------------- popdownmenu fields ------------------ */
  109.     MENU *mnu;        /* points to menu structure             */
  110.     MBAR *holdmenu; /* previous active menu                 */
  111.     /* --------------- help box fields -------------------- */
  112.     void *firstword; /* -> first in list of key words       */
  113.     void *lastword;  /* -> last in list of key words        */
  114.     void *thisword;  /* -> current in list of key words     */
  115.     /* -------------- status bar fields ------------------- */
  116.     int TimePosted;  /* True if time has been posted        */
  117.     /* ------------- picture box fields ------------------- */
  118.     int VectorCount;  /* number of vectors in vector list   */
  119.     void *VectorList; /* list of picture box vectors        */
  120. } * WINDOW;
  121.  
  122. #include "classdef.h"
  123. #include "video.h"
  124.  
  125. enum Condition     {
  126.     ISRESTORED, ISMINIMIZED, ISMAXIMIZED, ISCLOSING
  127. };
  128.  
  129. void LogMessages (WINDOW, MESSAGE, PARAM, PARAM);
  130. void MessageLog(WINDOW);
  131. /* ------- window methods ----------- */
  132. #define ICONHEIGHT 3
  133. #define ICONWIDTH  10
  134. #define WindowHeight(w)      ((w)->ht)
  135. #define WindowWidth(w)       ((w)->wd)
  136. #define BorderAdj(w)         (TestAttribute(w,HASBORDER)?1:0)
  137. #define BottomBorderAdj(w)   (TestAttribute(w,HASSTATUSBAR)?1:BorderAdj(w))
  138. #define TopBorderAdj(w)      ((TestAttribute(w,HASTITLEBAR) &&   \
  139.                               TestAttribute(w,HASMENUBAR)) ?  \
  140.                               2 : (TestAttribute(w,HASTITLEBAR | \
  141.                               HASMENUBAR | HASBORDER) ? 1 : 0))
  142. #define ClientWidth(w)       (WindowWidth(w)-BorderAdj(w)*2)
  143. #define ClientHeight(w)      (WindowHeight(w)-TopBorderAdj(w)-\
  144.                               BottomBorderAdj(w))
  145. #define WindowRect(w)        ((w)->rc)
  146. #define GetTop(w)            (RectTop(WindowRect(w)))
  147. #define GetBottom(w)         (RectBottom(WindowRect(w)))
  148. #define GetLeft(w)           (RectLeft(WindowRect(w)))
  149. #define GetRight(w)          (RectRight(WindowRect(w)))
  150. #define GetClientTop(w)      (GetTop(w)+TopBorderAdj(w))
  151. #define GetClientBottom(w)   (GetBottom(w)-BottomBorderAdj(w))
  152. #define GetClientLeft(w)     (GetLeft(w)+BorderAdj(w))
  153. #define GetClientRight(w)    (GetRight(w)-BorderAdj(w))
  154. #define GetParent(w)         ((w)->parent)
  155. #define GetTitle(w)          ((w)->title)
  156. #define NextWindow(w)        ((w)->nextfocus)
  157. #define PrevWindow(w)        ((w)->prevfocus)
  158. #define NextWindowBuilt(w)   ((w)->nextbuilt)
  159. #define PrevWindowBuilt(w)   ((w)->prevbuilt)
  160. #define GetClass(w)          ((w)->class)
  161. #define GetAttribute(w)      ((w)->attrib)
  162. #define AddAttribute(w,a)    (GetAttribute(w) |= a)
  163. #define ClearAttribute(w,a)  (GetAttribute(w) &= ~(a))
  164. #define TestAttribute(w,a)   (GetAttribute(w) & (a))
  165. #define isWndVisible(w)      (GetAttribute(w) & VISIBLE)
  166. #define SetVisible(w)        (GetAttribute(w) |= VISIBLE)
  167. #define ClearVisible(w)      (GetAttribute(w) &= ~VISIBLE)
  168. #define gotoxy(w,x,y) cursor(w->rc.lf+(x)+1,w->rc.tp+(y)+1)
  169. int isVisible(WINDOW);
  170. WINDOW CreateWindow(CLASS,char *,int,int,int,int,void*,WINDOW,
  171.        int (*)(struct window *,enum messages,PARAM,PARAM),int);
  172. void AddTitle(WINDOW, char *);
  173. void InsertTitle(WINDOW, char *);
  174. void DisplayTitle(WINDOW, RECT *);
  175. void RepaintBorder(WINDOW, RECT *);
  176. void ClearWindow(WINDOW, RECT *, int);
  177. void writeline(WINDOW, char *, int, int, int);
  178. void InitWindowColors(WINDOW);
  179.  
  180. void SetNextFocus(WINDOW);
  181. void SetPrevFocus(WINDOW);
  182. void SkipSystemWindows(int);
  183. void RemoveFocusWindow(WINDOW);
  184. void AppendFocusWindow(WINDOW);
  185. void PrependFocusWindow(WINDOW);
  186. void RemoveBuiltWindow(WINDOW);
  187. void AppendBuiltWindow(WINDOW);
  188. WINDOW GetFirstChild(WINDOW);
  189. WINDOW GetNextChild(WINDOW, WINDOW);
  190. WINDOW GetLastChild(WINDOW);
  191. WINDOW GetPrevChild(WINDOW, WINDOW);
  192. WINDOW GetFirstFocusChild(WINDOW);
  193. WINDOW GetNextFocusChild(WINDOW, WINDOW);
  194.  
  195. int CharInView(WINDOW, int, int);
  196. void GetVideoBuffer(WINDOW);
  197. void RestoreVideoBuffer(WINDOW);
  198. void CreatePath(char *, char *, int, int);
  199. int LineLength(char *);
  200. RECT AdjustRectangle(WINDOW, RECT);
  201. int isDerivedFrom(WINDOW, CLASS);
  202. WINDOW GetAncestor(WINDOW);
  203. void PutWindowChar(WINDOW,int,int,int);
  204. #define PutWindowLine(w,s,x,y) wputs(w,s,x+BorderAdj(w),y+TopBorderAdj(w))
  205. #define BaseWndProc(class,wnd,msg,p1,p2)    \
  206.     (*classdefs[(classdefs[class].base)].wndproc)(wnd,msg,p1,p2)
  207. #define DefaultWndProc(wnd,msg,p1,p2)         \
  208.     (classdefs[wnd->class].wndproc == NULL) ? \
  209.     BaseWndProc(wnd->class,wnd,msg,p1,p2) :      \
  210.     (*classdefs[wnd->class].wndproc)(wnd,msg,p1,p2)
  211. struct LinkedList    {
  212.     WINDOW FirstWindow;
  213.     WINDOW LastWindow;
  214. };
  215. extern struct LinkedList Focus;
  216. extern struct LinkedList Built;
  217. extern WINDOW inFocus;
  218. extern WINDOW CaptureMouse;
  219. extern WINDOW CaptureKeyboard;
  220. extern int foreground, background;
  221. extern int WindowMoving;
  222. extern int WindowSizing;
  223. extern int TextMarking;
  224. extern int VSliding;
  225. extern int HSliding;
  226. extern char *Clipboard;
  227. extern int ClipboardLength;
  228. extern int VSliding;
  229. extern int HSliding;
  230. extern char DFlatApplication[];
  231. extern int ClipString;
  232. /* --------- space between menubar labels --------- */
  233. #define MSPACE 2
  234. /* --------------- border characters ------------- */
  235. #define FOCUS_NW      (unsigned char) '\xc9'
  236. #define FOCUS_NE      (unsigned char) '\xbb'
  237. #define FOCUS_SE      (unsigned char) '\xbc'
  238. #define FOCUS_SW      (unsigned char) '\xc8'
  239. #define FOCUS_SIDE    (unsigned char) '\xba'
  240. #define FOCUS_LINE    (unsigned char) '\xcd'
  241. #define NW            (unsigned char) '\xda'
  242. #define NE            (unsigned char) '\xbf'
  243. #define SE            (unsigned char) '\xd9'
  244. #define SW            (unsigned char) '\xc0'
  245. #define SIDE          (unsigned char) '\xb3'
  246. #define LINE          (unsigned char) '\xc4'
  247. #define LEDGE         (unsigned char) '\xc3'
  248. #define REDGE         (unsigned char) '\xb4'
  249. /* ------------- scroll bar characters ------------ */
  250. #define UPSCROLLBOX    (unsigned char) '\x1e'
  251. #define DOWNSCROLLBOX  (unsigned char) '\x1f'
  252. #define LEFTSCROLLBOX  (unsigned char) '\x11'
  253. #define RIGHTSCROLLBOX (unsigned char) '\x10'
  254. #define SCROLLBARCHAR  (unsigned char) 176 
  255. #define SCROLLBOXCHAR  (unsigned char) 178
  256. /* ------------------ menu characters --------------------- */
  257. #define CHECKMARK      (unsigned char) (SCREENHEIGHT==25?251:4)
  258. #define CASCADEPOINTER (unsigned char) '\x10'
  259. /* ----------------- title bar characters ----------------- */
  260. #define CONTROLBOXCHAR (unsigned char) '\xf0'
  261. #define MAXPOINTER     24      /* maximize token            */
  262. #define MINPOINTER     25      /* minimize token            */
  263. #define RESTOREPOINTER 18      /* restore token             */
  264. /* --------------- text control characters ---------------- */
  265. #define APPLCHAR     (unsigned char) 176 /* fills application window */
  266. #define SHORTCUTCHAR '~'    /* prefix: shortcut key display */
  267. #define CHANGECOLOR  (unsigned char) 174 /* prefix to change colors  */
  268. #define RESETCOLOR   (unsigned char) 175 /* reset colors to default  */
  269. #define LISTSELECTOR   4    /* selected list box entry      */
  270. /* --------- message prototypes ----------- */
  271. void init_messages(void);
  272. void PostMessage(WINDOW, MESSAGE, PARAM, PARAM);
  273. int SendMessage(WINDOW, MESSAGE, PARAM, PARAM);
  274. int dispatch_message(void);
  275. int TestCriticalError(void);
  276. /* ---- standard window message processing prototypes ----- */
  277. int ApplicationProc(WINDOW, MESSAGE, PARAM, PARAM);
  278. int NormalProc(WINDOW, MESSAGE, PARAM, PARAM);
  279. int TextBoxProc(WINDOW, MESSAGE, PARAM, PARAM);
  280. int ListBoxProc(WINDOW, MESSAGE, PARAM, PARAM);
  281. int EditBoxProc(WINDOW, MESSAGE, PARAM, PARAM);
  282. int PictureProc(WINDOW, MESSAGE, PARAM, PARAM);
  283. int MenuBarProc(WINDOW, MESSAGE, PARAM, PARAM);
  284. int PopDownProc(WINDOW, MESSAGE, PARAM, PARAM);
  285. int ButtonProc(WINDOW, MESSAGE, PARAM, PARAM);
  286. int ComboProc(WINDOW, MESSAGE, PARAM, PARAM);
  287. int TextProc(WINDOW, MESSAGE, PARAM, PARAM);
  288. int RadioButtonProc(WINDOW, MESSAGE, PARAM, PARAM);
  289. int CheckBoxProc(WINDOW, MESSAGE, PARAM, PARAM);
  290. int SpinButtonProc(WINDOW, MESSAGE, PARAM, PARAM);
  291. int BoxProc(WINDOW, MESSAGE, PARAM, PARAM);
  292. int DialogProc(WINDOW, MESSAGE, PARAM, PARAM);
  293. int SystemMenuProc(WINDOW, MESSAGE, PARAM, PARAM);
  294. int HelpBoxProc(WINDOW, MESSAGE, PARAM, PARAM);
  295. int MessageBoxProc(WINDOW, MESSAGE, PARAM, PARAM);
  296. int CancelBoxProc(WINDOW, MESSAGE, PARAM, PARAM);
  297. int ErrorBoxProc(WINDOW, MESSAGE, PARAM, PARAM);
  298. int YesNoBoxProc(WINDOW, MESSAGE, PARAM, PARAM);
  299. int StatusBarProc(WINDOW, MESSAGE, PARAM, PARAM);
  300. /* ------------- normal box prototypes ------------- */
  301. int isWindow(WINDOW);
  302. WINDOW inWindow(int, int);
  303. void SetStandardColor(WINDOW);
  304. void SetReverseColor(WINDOW);
  305. #define HitControlBox(wnd, p1, p2)     \
  306.      (TestAttribute(wnd, CONTROLBOX) && \
  307.      p1 == 2 && p2 == 0)
  308. #define WndForeground(wnd)         \
  309.     (wnd->WindowColors [STD_COLOR] [FG])
  310. #define WndBackground(wnd)         \
  311.     (wnd->WindowColors [STD_COLOR] [BG])
  312. #define FrameForeground(wnd)     \
  313.     (wnd->WindowColors [FRAME_COLOR] [FG])
  314. #define FrameBackground(wnd)     \
  315.     (wnd->WindowColors [FRAME_COLOR] [BG])
  316. #define SelectForeground(wnd)     \
  317.     (wnd->WindowColors [SELECT_COLOR] [FG])
  318. #define SelectBackground(wnd)     \
  319.     (wnd->WindowColors [SELECT_COLOR] [BG])
  320. #define HighlightForeground(wnd)     \
  321.     (wnd->WindowColors [HILITE_COLOR] [FG])
  322. #define HighlightBackground(wnd)     \
  323.     (wnd->WindowColors [HILITE_COLOR] [BG])
  324. #define WindowClientColor(wnd, fg, bg)     \
  325.         WndForeground(wnd) = fg, WndBackground(wnd) = bg
  326. #define WindowReverseColor(wnd, fg, bg) \
  327.         SelectForeground(wnd) = fg, SelectBackground(wnd) = bg
  328. #define WindowFrameColor(wnd, fg, bg) \
  329.         FrameForeground(wnd) = fg, FrameBackground(wnd) = bg
  330. #define WindowHighlightColor(wnd, fg, bg) \
  331.         HighlightForeground(wnd) = fg, HighlightBackground(wnd) = bg
  332. /* -------- text box prototypes ---------- */
  333. #define TextLine(wnd, sel) \
  334.       (wnd->text + *((wnd->TextPointers) + sel))
  335. void WriteTextLine(WINDOW, RECT *, int, int);
  336. void SetAnchor(WINDOW, int, int);
  337. #define TextBlockMarked(wnd) (  wnd->BlkBegLine ||    \
  338.                                 wnd->BlkEndLine ||    \
  339.                                 wnd->BlkBegCol  ||    \
  340.                                 wnd->BlkEndCol)
  341. void MarkTextBlock(WINDOW, int, int, int, int);
  342. #define ClearTextBlock(wnd) wnd->BlkBegLine = wnd->BlkEndLine =  \
  343.                         wnd->BlkBegCol  = wnd->BlkEndCol = 0;
  344. #define GetText(w)        ((w)->text)
  345. void ClearTextPointers(WINDOW);
  346. void BuildTextPointers(WINDOW);
  347. int TextLineNumber(WINDOW, char *);
  348. void CopyToClipboard(WINDOW);
  349. #define PasteFromClipboard(wnd) PasteText(wnd,Clipboard,ClipboardLength)
  350. void PasteText(WINDOW, char *, int);
  351. /* --------- menu prototypes ---------- */
  352. int CopyCommand(unsigned char *, unsigned char *, int, int);
  353. void PrepFileMenu(void *, struct Menu *);
  354. void PrepEditMenu(void *, struct Menu *);
  355. void PrepSearchMenu(void *, struct Menu *);
  356. void PrepWindowMenu(void *, struct Menu *);
  357. void BuildSystemMenu(WINDOW);
  358. int isActive(MBAR *, int);
  359. char *GetCommandText(MBAR *, int);
  360. int isCascadedCommand(MBAR *,int);
  361. void ActivateCommand(MBAR *,int);
  362. void DeactivateCommand(MBAR *,int);
  363. int GetCommandToggle(MBAR *,int);
  364. void SetCommandToggle(MBAR *,int);
  365. void ClearCommandToggle(MBAR *,int);
  366. void InvertCommandToggle(MBAR *,int);
  367. int BarSelection(int);
  368. /* ------------- list box prototypes -------------- */
  369. int ItemSelected(WINDOW, int);
  370. /* ------------- edit box prototypes ----------- */
  371. #define CurrChar (TextLine(wnd, wnd->CurrLine)+wnd->CurrCol)
  372. #define WndCol   (wnd->CurrCol-wnd->wleft)
  373. #define isMultiLine(wnd)     TestAttribute(wnd, MULTILINE)
  374. void SearchText(WINDOW);
  375. void ReplaceText(WINDOW);
  376. void SearchNext(WINDOW);
  377. /* --------- message box prototypes -------- */
  378. int GenericMessage(WINDOW, char *, char *, int,
  379.     int (*)(struct window *, enum messages, PARAM, PARAM),
  380.     char *, char *, int, int, int);
  381. #define TestErrorMessage(msg)    \
  382.     GenericMessage(NULL, "Error", msg, 2, ErrorBoxProc,      \
  383.         Ok, Cancel, ID_OK, ID_CANCEL, TRUE)
  384. #define ErrorMessage(msg) \
  385.     GenericMessage(NULL, "Error", msg, 1, ErrorBoxProc,   \
  386.         Ok, NULL, ID_OK, 0, TRUE)
  387. #define MessageBox(ttl, msg) \
  388.     GenericMessage(NULL, ttl,     msg, 1, MessageBoxProc, \
  389.         Ok, NULL, ID_OK, 0, TRUE)
  390. #define YesNoBox(msg)    \
  391.     GenericMessage(NULL, NULL,    msg, 2, YesNoBoxProc,   \
  392.         Yes, No, ID_OK, ID_CANCEL, TRUE)
  393. #define CancelBox(wnd, msg) \
  394.     GenericMessage(wnd, "Wait...", msg, 1, CancelBoxProc, \
  395.         Cancel, NULL, ID_CANCEL, 0, FALSE)
  396. void CloseCancelBox(void);
  397. WINDOW MomentaryMessage(char *);
  398. int MsgHeight(char *);
  399. int MsgWidth(char *);
  400.  
  401. /* ------------- dialog box prototypes -------------- */
  402. int DialogBox(WINDOW, DBOX *, int,
  403.        int (*)(struct window *, enum messages, PARAM, PARAM));
  404. int OpenFileDialogBox(char *, char *);
  405. int SaveAsDialogBox(char *);
  406. void GetDlgListText(WINDOW, char *, enum commands);
  407. int DlgDirList(WINDOW, char *, enum commands,
  408.                             enum commands, unsigned);
  409. int RadioButtonSetting(DBOX *, enum commands);
  410. void PushRadioButton(DBOX *, enum commands);
  411. void PutItemText(WINDOW, enum commands, char *);
  412. void PutComboListText(WINDOW, enum commands, char *);
  413. void GetItemText(WINDOW, enum commands, char *, int);
  414. char *GetDlgTextString(DBOX *, enum commands, CLASS);
  415. void SetDlgTextString(DBOX *, enum commands, char *, CLASS);
  416. void SetCheckBox(DBOX *, enum commands);
  417. void ClearCheckBox(DBOX *, enum commands);
  418. int CheckBoxSetting(DBOX *, enum commands);
  419. CTLWINDOW *FindCommand(DBOX *, enum commands, int);
  420. WINDOW ControlWindow(DBOX *, enum commands);
  421. void EnableButton(DBOX *, enum commands);
  422. void DisableButton(DBOX *, enum commands);
  423. #define GetControl(wnd) (wnd->ct)
  424.  
  425. #define GetDlgText(db, cmd) GetDlgTextString(db, cmd, TEXT)
  426. #define GetDlgTextBox(db, cmd) GetDlgTextString(db, cmd, TEXTBOX)
  427. #define GetEditBoxText(db, cmd) GetDlgTextString(db, cmd, EDITBOX)
  428. #define GetComboBoxText(db, cmd) GetDlgTextString(db, cmd, COMBOBOX)
  429. #define SetDlgText(db, cmd, s) SetDlgTextString(db, cmd, s, TEXT)
  430. #define SetDlgTextBox(db, cmd, s) SetDlgTextString(db, cmd, s, TEXTBOX)
  431. #define SetEditBoxText(db, cmd, s) SetDlgTextString(db, cmd, s, EDITBOX)
  432. #define SetComboBoxText(db, cmd, s) SetDlgTextString(db, cmd, s, COMBOBOX)
  433.  
  434. /* ---- types of vectors that can be in a picture box ------- */
  435. enum VectTypes {VECTOR, SOLIDBAR, HEAVYBAR, CROSSBAR, LIGHTBAR};
  436.  
  437. /* ------------- picture box prototypes ------------- */
  438. void DrawVector(WINDOW, int, int, int, int);
  439. void DrawBox(WINDOW, int, int, int, int);
  440. void DrawBar(WINDOW, enum VectTypes, int, int, int, int);
  441.  
  442. /* ------------- help box prototypes ------------- */
  443. void LoadHelpFile(void);
  444. void UnLoadHelpFile(void);
  445. int DisplayHelp(WINDOW, char *);
  446.  
  447. extern char *ClassNames[];
  448.  
  449. #endif
  450.